package com.xingu.xg.domain;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.xingu.xg.vo.AddNodeQuery;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.validation.constraints.NotEmpty;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.List;

/**
 * (XgMenu)实体类
 *
 * @author L
 * @since 2024-05-16 00:04:19
 */
@JsonInclude(value = JsonInclude.Include.NON_NULL)
@Data
@AllArgsConstructor
@NoArgsConstructor
public class XgMenu implements Serializable {
    private static final long serialVersionUID = 236439019718293176L;
    // /**
    //  * 主键
    //  */
    // @TableId(type = IdType.AUTO)
    // private Long id;
    /**
     * 项目ID
     */
    @TableId(type = IdType.ASSIGN_ID)
    private String projectId;
    /**
     * 名称
     */
    private String name;
    /**
     * 单位
     */
    private String unit;
    /**
     * 数量
     */
    private Integer num;
    /**
     * 供应单价
     */
    private BigDecimal supplyPrice;
    /**
     * 安装单价
     */
    private BigDecimal installPrice;
    /**
     * 上个项目Id
     */
    private String preId;
    /**
     * 下个项目Id
     */
    private String nextId;
    /**
     * 父节点id
     * addNode接口,同级节点不传递父节点
     */
    private String parentId;
    /**
     * 层级
     */
    @NotEmpty(groups = {AddNodeQuery.class})
    private Integer level;
    /**
     * 逻辑删除
     */
    @JsonInclude(value = JsonInclude.Include.NON_NULL)
    @TableLogic
    private String status;
    /**
     * 版本
     */
    @JsonInclude(value = JsonInclude.Include.NON_NULL)
    private Integer version;
    /**
     * 子项目
     */
    @JsonInclude(value = JsonInclude.Include.NON_NULL)
    @TableField(exist = false)
    private List<XgMenu> children;
    /**
     * 叶子节点
     */
    @JsonInclude(value = JsonInclude.Include.NON_NULL)
    @TableField(exist = false)
    private Boolean leaf=false;

}


